package com.gxsyh.nantie.dining.provider.service.impl;

import com.gxsyh.nantie.dining.provider.domain.TbDepartmentSubsidyUpdateTime;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.gxsyh.nantie.dining.provider.mapper.TbDepartmentSubsidyUpdateTimeMapper;
import com.gxsyh.nantie.dining.provider.service.TbDepartmentSubsidyUpdateTimeService;
import tk.mybatis.mapper.entity.Example;

/**
 * @email yom535@outlook.com
 * @author: 刘锋嘉(Liu Fengjia)
 * @date: 2020/1/10
 * @time: 09:33
 * @Description: 
 */
@Service
public class TbDepartmentSubsidyUpdateTimeServiceImpl implements TbDepartmentSubsidyUpdateTimeService{

    @Resource
    private TbDepartmentSubsidyUpdateTimeMapper tbDepartmentSubsidyUpdateTimeMapper;

    @Override
    public int insterTbDepartmentSubsidyUpdateTime(Long id,Long departmentId,String subsidyUpdateTime) {
        TbDepartmentSubsidyUpdateTime tbDepartmentSubsidyUpdateTime=new TbDepartmentSubsidyUpdateTime();
        tbDepartmentSubsidyUpdateTime.setId(id);
        tbDepartmentSubsidyUpdateTime.setDepartmentId(departmentId);
        tbDepartmentSubsidyUpdateTime.setSubsidyUpdateTime(subsidyUpdateTime);
        return tbDepartmentSubsidyUpdateTimeMapper.insert(tbDepartmentSubsidyUpdateTime);
    }

    @Override
    public int deleteTbDepartmentSubsidyUpdateTime(Long departmentId) {
        Example example=new Example(TbDepartmentSubsidyUpdateTime.class);
        example.createCriteria().andEqualTo("departmentId",departmentId);
        return tbDepartmentSubsidyUpdateTimeMapper.deleteByExample(example);
    }

    @Override
    public TbDepartmentSubsidyUpdateTime selectOneTbDepartmentSubsidyUpdateTime(Long departmentId) {
        Example example=new Example(TbDepartmentSubsidyUpdateTime.class);
        example.createCriteria().andEqualTo("departmentId",departmentId);
        return tbDepartmentSubsidyUpdateTimeMapper.selectOneByExample(example);
    }
}
